#pragma once
#include <core/context.hpp>
#include <memory>
#include <rclcpp/rclcpp.hpp>

class Task
{
  protected:
    std::string name;
    std::shared_ptr<Context> context;

  public:
    Task(std::string name, std::shared_ptr<Context> context)
        : name(name), context(context) {};
    std::string getName() { return name; }
    // true for accept
    virtual bool OnInit() = 0;
    // 1 for success, -1 for fail, 0 for runing
    virtual int OnStep(double &precent) = 0;
    // true for cancle this task, false for reject
    virtual bool OnCancle() = 0;
};
